# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=loic
pkgver=2.9.9.99
pkgrel=4
pkgdesc='An open source network stress tool for Windows.'
groups=('blackarch' 'blackarch-networking' 'blackarch-windows')
arch=('any')
url='https://github.com/NewEraCracker/LOIC'
depends=('mono')
makedepends=('monodevelop')
license=('GPL')
source=("https://github.com/NewEraCracker/LOIC/archive/$pkgver.tar.gz"
	      'loic.desktop'
        'loic.png')
sha512sums=('0cee91b1ce442ad84173a3bce680d87121ec0d417eace85d521eee8248172e7a0635f8ce47acb30e046f3a885dd1ebb5edeb269bf0f0a504cbabd41f77dc6189'
            '26392bbde05dd7828d5485b11f12cd323daa563357e36b0e675e8dbf044ecbf9899867c481a370c8c8cf8a22fb612e80345c69b330ec9ee64274ba4edcaafe35'
            'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e')
build() {
	cd "LOIC-$pkgver"

	sed -i 's/3.5/4.0/g' "$srcdir/LOIC-$pkgver/src/IRC/IRC.csproj"
	sed -i 's/3.5/4.0/g' "$srcdir/LOIC-$pkgver/src/LOIC.csproj"

  cd src

  mdtool build
}

package() {
  cd "LOIC-$pkgver"

	install -dm 755 "$pkgdir/usr/share/windows/loic"

  install -Dm 755 "$srcdir/LOIC-$pkgver/src/bin/Debug/"* \
    "$pkgdir/usr/share/windows/$pkgname/"
  install -Dm 755 "$srcdir/loic.desktop" \
    "$pkgdir/usr/share/applications/loic.desktop"
  install -Dm 644 "$srcdir/loic.png" \
    "$pkgdir/usr/share/pixmaps/loic.png"
}

